<template>
  <el-button
    :type="type"
    :plain="plain"
    :icon="icon"
    :size="size"
    :disabled="disabled"
    :class="buttonclass"
    >{{ text }}</el-button
  >
</template>

<script>
export default {
  name: "Button",
  watch: {
    text(val) {
      if (val == "新增") {
        this.buttonclass = "addButton";
      }
    },
  },
  props: {
    text: {
      type: String,
      default: "按钮",
    },
    icon: {
      type: String,
      default: "el-icon-picture-outline-round",
    },
    plain: {
      type: Boolean,
      default: false,
    },
    type: {
      type: String,
      default: null,
    },
    size: {
      type: String,
      default: "null",
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      buttonclass: "",
    };
  },
  methods: {},
};
</script>
<style land="scss" scoped>
@import "./index.scss";
</style>